<html><head><title>Select : EndSelect</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="5">Select : EndSelect</font></b></p>

<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#006666">Select</font></b> &#060;expression1&#062;
  <b><font color="#006666">Case</font></b> &#060;expression&#062; [, &#060;expression&#062; [&#060;numeric expression&#062; To &#060;numeric expression&#062;]]
     ...
  [<b><font color="#006666">Case</font></b> &#060;expression&#062;]
     ...
  [<b><font color="#006666">Default</font></b>] 
     ...
<b><font color="#006666">EndSelect</font></b> 
</font></pre></blockquote>
<b>Description</b><br><blockquote>


<b><font color="#006666">Select</font></b> provides the ability to determine a quick choice. The program will execute the &#060;expression1&#062; and retain its' value in memory. 
It will then compare this value to all of the <b><font color="#006666">Case</font></b> &#060;expression&#062; values and if a given <b><font color="#006666">Case</font></b> &#060;expression&#062; value is true, 
it will then execute the corresponding code and quit the <b><font color="#006666">Select</font></b> structure. <b><font color="#006666">Case</font></b> supports multi-values and value ranges 
through the use of the optional <b><font color="#006666">To</font></b> keyword (numeric values only). If none of the <b><font color="#006666">Case</font></b> values are true, then the <b><font color="#006666">Default</font></b> 
code will be executed (if specified). 

<br>
<br>
Note: <b><font color="#006666">Select</font></b> will accept <a href="../reference/variables.html">floats</a> as &#060;expression1&#062; but will round them down to the nearest integer (comparisons 
will be done only with integer values). 


</blockquote><p><b>Example:</b> Simple example</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  Value = 2
  
  <b><font color="#006666">Select</font></b> Value
    <b><font color="#006666">Case</font></b> 1
      <b><font color="#006666">Debug</font></b> "Value = 1"
      
    <b><font color="#006666">Case</font></b> 2 
      <b><font color="#006666">Debug</font></b> "Value = 2"
      
    <b><font color="#006666">Case</font></b> 20 
      <b><font color="#006666">Debug</font></b> "Value = 20"
      
    <b><font color="#006666">Default</font></b>
      <b><font color="#006666">Debug</font></b> "I don't know"
  <b><font color="#006666">EndSelect</font></b>
</font></pre>

</blockquote><p><b>Example:</b> Multicase and range example</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  Value = 2
  
  <b><font color="#006666">Select</font></b> Value
    <b><font color="#006666">Case</font></b> 1, 2, 3
      <b><font color="#006666">Debug</font></b> "Value is 1, 2 or 3"
      
    <b><font color="#006666">Case</font></b> 10 <b><font color="#006666">To</font></b> 20, 30, 40 <b><font color="#006666">To</font></b> 50
      <b><font color="#006666">Debug</font></b> "Value is between 10 and 20, equal to 30 or between 40 and 50"
      
    <b><font color="#006666">Default</font></b>
      <b><font color="#006666">Debug</font></b> "I don't know"
      
  <b><font color="#006666">EndSelect</font></b>
</font></pre>
</body></html>